import BaseService from './_BaseService'
import axios from 'axios'
import config from '../config'

class TaskTypeService extends BaseService {
  root = window.apiPath + '/plans'

  searchAll = super.search

  search (page, query = '') {
    return axios.get(config.SERVER_URL + window.apiPath + `/plans-ps?page=${page}&size=${config.PAGE_SIZE}&query=${query}`, {responseType: 'json'})
      .then(res => res)
  }

  filter (page, query = '', pageSize = config.PAGE_SIZE) {
    return axios.get(config.SERVER_URL + window.apiPath + `/plans-filter?page=${page}&size=${pageSize}&${query}`, {responseType: 'json'})
      .then(res => res)
  }
}

export default new TaskTypeService()
